package com.ruoyi.system.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.SysAttendanceRecord;
import com.ruoyi.system.mapper.SysAttendanceRecordMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SysHomeworkMapper;
import com.ruoyi.system.domain.SysHomework;
import com.ruoyi.system.service.ISysHomeworkService;

/**
 * 作业管理Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-04-21
 */
@Service
public class SysHomeworkServiceImpl extends ServiceImpl<SysHomeworkMapper, SysHomework> implements ISysHomeworkService
{
    @Autowired
    private SysHomeworkMapper sysHomeworkMapper;

    /**
     * 查询作业管理
     * 
     * @param id 作业管理主键
     * @return 作业管理
     */
    @Override
    public SysHomework selectSysHomeworkById(Long id)
    {
        return sysHomeworkMapper.selectSysHomeworkById(id);
    }

    /**
     * 查询作业管理列表
     * 
     * @param sysHomework 作业管理
     * @return 作业管理
     */
    @Override
    public List<SysHomework> selectSysHomeworkList(SysHomework sysHomework)
    {
        return sysHomeworkMapper.selectSysHomeworkList(sysHomework);
    }

    /**
     * 新增作业管理
     * 
     * @param sysHomework 作业管理
     * @return 结果
     */
    @Override
    public int insertSysHomework(SysHomework sysHomework)
    {
        sysHomework.setCreateTime(DateUtils.getNowDate());
        return sysHomeworkMapper.insertSysHomework(sysHomework);
    }

    /**
     * 修改作业管理
     * 
     * @param sysHomework 作业管理
     * @return 结果
     */
    @Override
    public int updateSysHomework(SysHomework sysHomework)
    {
        sysHomework.setUpdateTime(DateUtils.getNowDate());
        return sysHomeworkMapper.updateSysHomework(sysHomework);
    }

    /**
     * 批量删除作业管理
     * 
     * @param ids 需要删除的作业管理主键
     * @return 结果
     */
    @Override
    public int deleteSysHomeworkByIds(Long[] ids)
    {
        return sysHomeworkMapper.deleteSysHomeworkByIds(ids);
    }

    /**
     * 删除作业管理信息
     * 
     * @param id 作业管理主键
     * @return 结果
     */
    @Override
    public int deleteSysHomeworkById(Long id)
    {
        return sysHomeworkMapper.deleteSysHomeworkById(id);
    }
}
